#include "Shadowmancer.h"
#include "Player.h"
#include "Game.h"
#include "../SGD Wrappers/SGD_GraphicsManager.h"
#include "BossPlanets.h"

Shadowmancer::Shadowmancer(Entity* t, BossPlanets*b) : Enemy(t)
{
	boss = b;
	range = 500;
	attached = false;
}


Shadowmancer::~Shadowmancer()
{
}

void Shadowmancer::Update(float elapsedTime)
{
	state = State::track;
	fireTimer -= elapsedTime;
	Aggro();
	if (!boss->GetAlive())
		state = State::track;

	machine.update(*this, elapsedTime);
	Entity::Update(elapsedTime);

	if (0 > health)
		health = 0;
}
void Shadowmancer::Render()
{
	SGD::Rectangle rect;
	rect = { position.x - range - Game::GetInstance()->GetCameraPos().x, position.y - range - Game::GetInstance()->GetCameraPos().y,
		position.x + range - Game::GetInstance()->GetCameraPos().x, position.y + range - Game::GetInstance()->GetCameraPos().y };
	SGD::GraphicsManager::GetInstance()->DrawRectangle(
		rect, SGD::Color{ 80, 255, 255, 0 });
	rect = { SGD::Point{ position.x - Game::GetInstance()->GetCameraPos().x,
		position.y - Game::GetInstance()->GetCameraPos().y }, size };
	SGD::GraphicsManager::GetInstance()->DrawRectangle(
		rect, SGD::Color{ 255, 0, 0 });

}